-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement non-linear scaling for NDVI hybrid green correction #2554
Implement non-linear scaling for NDVI hybrid green correction #2554
Conversation
…n when converting NDVI to blend fraction.
…ith EUMETSAT recipe used for first public images.
Codecov Report
@@ Coverage Diff @@
## main #2554 +/- ##
=======================================
Coverage 94.91% 94.91%
=======================================
Files 351 351
Lines 51217 51235 +18
=======================================
+ Hits 48613 48631 +18
Misses 2604 2604
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, no changes to suggest to the existing code.
That said, I currently have a PR open (#2555) that updates the AMI composites to use the existing NDVI hybrid green method. If acceptable, could we merge that one and then also update the AMI composites to make use of this new non-linear hybrid green?
Would be great if we can, but I can also make a separate PR for that later if preferred.
@simonrp84 Thanks for reviewing! For me it's fine to first merge your PR and then I'd pull it and update the recipes based on the changes in my PR, if that's what your asking? |
Sorry @strandgren I wasn't clear! Yes, that's what I am asking :) |
#2555 is now merged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a couple of styling comments
…nonlinear_ndvi_green_correction
I've now merged the latest main (including the changes in #2555) and added the non-linear strength term to the AMI ndvi_hybrid_green recipes. |
Pull Request Test Coverage Report for Build 6224392120
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This PR extends on the NDVI hybrid green correction implemented in #2280 for improved True Color imagery with sensors having a green channel that misses the chlorophyll peak around 0.55 microns.
The previous implementation used a linear scaling from pixel-level NDVI to a fractional value determining how large fraction of the NIR signal that should be blended with the green signal to compute the hybrid green.
With this PR, the possibility to perform a non-linear scaling is implemented. The user defines the parameter
strength
, which controls the strength of the non-linearity.The figure below show the behavior in Satpy main (linear scaling with no other option) as well as the behavior with this PR, where the scaling is non-linear with the shape and strength depending on the parameter
strength
.It can be seen that by setting
strength = 1.0
the current non-linear scaling is used. This is also the default in the compositor. Astrength
higher than 1.0 will result in a slower transition to higher/lower fractions at the NDVI extremes. Similarly, astrength
smaller than 1.0 will result in a faster transition to higher/lower fractions at the NDVI extremes.The new implementation used in this PR has been used for the release of the first FCI RGB imagery, and based on initial analysis a strength of 3.0 has been chosen as default for the
ndvi_hybrid_green
recipe used for thetrue_color
. The same has been done for AHI (true_color_ndvi_green
composite). As mentioned in the docstring, this value may change in the future when more data are available.Some example results can be seen below:
From a first glance the images are rather similar, but it can be seen that with this PR more deep green colors (e.g. over Brazil) can be achieved, without having a reddening effect over the Sahara desert (which would be the case with the linear scaling). Similar patterns are seen for dense vegetation in south-east Asia and the barren surface in Australia.